#!/bin/bash

source ./porousGasificationMediaDirectories

# If folders already exist a warning message will be showed
mkdir -p $WM_PROJECT_USER_DIR
mkdir -p $WM_PROJECT_USER_DIR/applications
mkdir -p $FOAM_HGS


cp -r porousGasificationFoam $WM_PROJECT_USER_DIR/applications/
cp -r utilities/totalMassPorousGasificationFoam $WM_PROJECT_USER_DIR/applications/
cp -r porousGasificationMedia/porousReactingMedia $FOAM_HGS/
cp -r porousGasificationMedia/thermophysicalModels $FOAM_HGS/
cp -r porousGasificationMedia/pyrolysisModels $FOAM_HGS/

cd $FOAM_HGS/porousReactingMedia
wmake libso

cd $FOAM_HGS/thermophysicalModels
./Allwmake

cd $FOAM_HGS/pyrolysisModels
wmake libso

cd $WM_PROJECT_USER_DIR/applications/porousGasificationFoam
wmake

cd $WM_PROJECT_USER_DIR/applications/totalMassPorousGasificationFoam
wmake
